﻿using GalaSoft.MvvmLight;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CastingWellEquipmentGUI.Model
{
    /// <summary>
    /// 用户操作模型
    /// </summary>
    public class User : ObservableObject
    {
        /// <summary>
        /// 用户表主键
        /// </summary>
        private int _UserId;
        public int UserId
        {
            get { return _UserId; }
            set
            {
                _UserId = value;
                RaisePropertyChanged(() => _UserId);
            }
        }

        /// <summary>
        /// 账号
        /// </summary>
        private string _Account;
        /// <summary>
        /// 账号
        /// </summary>
        public string Account
        {
            get { return _Account; }
            set
            {
                _Account = value;
                RaisePropertyChanged(() => Account);
            }
        }
        /// <summary>
        /// 用户名
        /// </summary>
        private string _UserName;
        /// <summary>
        /// 用户名
        /// </summary>
        public string UserName
        {
            get { return _UserName; }
            set
            {
                _UserName = value;
                RaisePropertyChanged(() => UserName);
            }
        }
        /// <summary>
        /// 密码
        /// </summary>
        private string _Password;
        /// <summary>
        /// 密码
        /// </summary>
        public string Password
        {
            get { return _Password; }
            set
            {
                _Password = value;
                RaisePropertyChanged(() => Password);
            }
        }

        /// <summary>
        /// 是否是管理员
        /// </summary>
        private bool _IsAdmin;
        /// <summary>
        /// 是否是管理员
        /// </summary>
        public bool IsAdmin
        {
            get { return _IsAdmin; }
            set
            {
                _IsAdmin = value;
                RaisePropertyChanged(() => IsAdmin);
            }
        }

        /// <summary>
        /// 是否是管理员
        /// </summary>
        private int _Status;
        /// <summary>
        /// 是否是管理员
        /// </summary>
        public int Status
        {
            get { return _Status; }
            set
            {
                _Status = value;
                RaisePropertyChanged(() => Status);
            }
        }
        /// <summary>
        /// 拥有的角色
        /// </summary>
        private ObservableCollection<Role> _Roles = new ObservableCollection<Role>();
        /// <summary>
        /// 拥有的角色
        /// </summary>
        public ObservableCollection<Role> Roles
        {
            get { return _Roles; }
            set
            {
                _Roles = value;
                RaisePropertyChanged(() => Roles);
            }
        }
    }
}
